<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'A heavy study day',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2017/10/13.jpg" alt="The view from the front of my workplace" class="framed-centred-image" width="800" height="480"/>
<section id="university">
	<h2>University life</h2>
	<p>
		For the first time in ages, I started and completed a discussion assignment in one day, without it being at the last minute:
	</p>
	<blockquote>
		<p>
			$a[AJAX] is an acronym standing for &quot;asynchronous JavaScript and $a[XML]&quot;
			However, contradicting its namesake, it doesn&apos;t even always involve $a[XML] in any way (W3Schools, n.d.).
			JavaScript is used to use a Web browser&apos;s <code>XMLHttpRequest</code> object to make requests for files over the network.
			The request could be used to update data on the server, the response could be used to update data on the page without reloading, or both could happen.
		</p>
		<p>
			$a[AJAX] is a powerful tool, but with that power comes responsibility.
			$a[AJAX] requests should never be sent when not expected by the user.
			$a[AJAX] can be used when a page loads, when a user submits a form, when a user clicks a button, et cetera.
			However, $a[AJAX] requests should <strong>*never*</strong> be sent on some sort of timer.
			$a[AJAX] requests lock the page up so users can&apos;t interact with it until the response has completed.
			University of <span class="redacted">[REDACTED]</span>&apos;s classroom website (Moodle) suffers from this serious design flaw.
			It makes completing discussion posts, completing grading, and even just navigating the website a huge pain, especially on a slower network connection.
			I&apos;ve had to completely disable JavaScript in my Web browser just to deal with this website&apos;s buggy use of $a[AJAX].
			<strong>*Please*</strong> be kind to your users.
			<strong>*Please*</strong> use $a[AJAX] responsibly.
			Please <strong>*never*</strong> rig $a[AJAX] requests to run on a reoccurring timer.
		</p>
		<p>
			The main characteristics of $a[AJAX] are that it locks the page (and should therefore not be used when a user is likely to be typing or clicking around), it requires JavaScript to function (and should therefore be used as an enhancement, not for main functionality of a page, as users may have JavaScript disabled), that it allows communication with the server without a page reload, and that it allows updating of the page without a page reload.
		</p>
		<p>
			I&apos;ve seen sites that use $a[AJAX] on a timer in a user-friendly way: they request only small files that tell the page if an update is even available.
			If there is, the page is updated to provide a button for the user to update the page.
			If the user clicks the button, they are then <strong>*expecting*</strong> an update, so it&apos;s much less problematic for the page to lock up for a bit.
			When requesting this tiny update information file, the page doesn&apos;t noticeably lock up either, because the request is completed so quickly.
			If you can&apos;t be kind to your users with your use of $a[AJAX], you&apos;re better off not using $a[AJAX] at all.
			There are also sometimes entire websites seemingly built entirely out of $a[AJAX].
			These websites are incredibly slow to load often times, and if JavaScript is disabled, these pages appear blank to the user with no explanation as to why.
			Using $a[AJAX] to update a few peripheral components is one thing, but if your entire page is composed of nothing but $a[AJAX], you have some serious design flaws.
			I have two main credit card accounts.
			To pay off either online, I have to enable JavaScript because the credit card websites were not built with accessibility in mind at all.
			However, the Discover website is composed of mostly $a[XHTML]/$a[HTML], and is therefore quick to respond.
			The section of the Chase website used for account management is composed nearly entirely of $a[AJAX], so it takes several minutes for the initial page to even reach a usable state.
			Sure, the site is responsive once everything has loaded, but waiting for it to load is a pain, and it doesn&apos;t even seem to load completely every time.
			So when I make a purchase with a credit card, which card do you think I&apos;m more likely to use?
			That&apos;s right, I use the Discover credit card anywhere that&apos;ll take it, because paying the bill for it is easy.
			I go months at a time without using the Chase credit card because doing so lets me go months at a time without visiting the horrid Chase website.
			The lesson here?
			If your website is for a business and you use too much $a[AJAX], you&apos;re going to lose money that you could&apos;ve otherwise earned.
			$a[AJAX] is not a replacement for standard $a[XHTML]/$a[HTML] pages, and should be used in moderation.
		</p>
		<p>
			When you use $a[AJAX] correctly though, you can create some powerful, live-updating Web applications.
			I&apos;ve seen comment systems is $a[AJAX] that alert users to the presence of new comments, and provide the option to load those comments if the user wishes.
			I&apos;ve seen gateway-like Web applications too, that allow one to access a different Internet service over the web.
			For example, $a[IRC] users typically need an $a[IRC] client to chat on $a[IRC], but people that aren&apos;t computer literate often are intimidated by the need to install a separate client to use a separate Internet protocol.
			For that, Web-based $a[IRC] clients have been built using $a[AJAX].
			While less functional than a native $a[IRC] client, these $a[AJAX] clients serve a population that otherwise wouldn&apos;t be using $a[IRC].
			$a[IRC] is a great fit for $a[AJAX] too because of how tiny $a[IRC] messages are (so $a[AJAX] requests are quickly filled and don&apos;t lock the page long).
			$a[AJAX] can likewise be used to update webpages of a more standard variety when a user clicks on something.
			Perhaps you have a news page and want new news stories to show up as they are added to your site.
			If your news page contains a summary of several news stories with links to the news stories themselves, $a[AJAX] can be a nice tool for adding the summaries and links to newly-published stories without having some page auto-refresh mechanism.
			While $a[AJAX] use can be annoying for users when poorly implemented, a full page reload happening automatically is going to annoy them even more and should be avoided at all costs.
			Some websites also use $a[AJAX] for form validation.
			Data is sent to the server, and if the server doesn&apos;t like it, an error message telling why not is presented to the user.
			This prevents the user from having to refill the form entirely.
			Instead, they only have to change the fields that the server doesn&apos;t like.
			This use of $a[AJAX] saves users time and effort!
		</p>
		<p>
			$a[AJAX] is built on the JavaScript standard and the $a[DOM] standard (W3Schools, n.d.).
			JavaScript is used to make $a[HTTP] requests using an <code>XMLHttpRequest</code> object, then used to change the page using $a[DOM] methods based on the response.
			When some event is triggered, which could be a page click or even the load of the page itself, a JavaScript script can create an <code>XMLHttpRequest</code> object, then use it to have the Web browser make a request to a Web server.
			The Web server processes and handles the request, and sends a response as it would any other $a[HTTP] request.
			The Web browser takes the response, and processes it with the JavaScript that requested it.
			Once the data is processed, the JavaScript updates the page using $a[DOM] methods accordingly.
		</p>
		<div class="APA_references">
			<h3>References:</h3>
			<p>
				W3Schools. (n.d.). AJAX Introduction. Retrieved from <a href="https://www.w3schools.com/xml/ajax_intro.asp"><code>https://www.w3schools.com/xml/ajax_intro.asp</code></a>
			</p>
		</div>
	</blockquote>
	<blockquote>
		<p>
			$a[AJAX] is a coder&apos;s dream, as you say, but it&apos;s not always a <strong>*user&apos;s*</strong> dream.
			When poorly used, $a[AJAX] is a nightmare for users.
			$a[AJAX] can indeed provide a seamless experience, but when poorly used, it often doesn&apos;t.
			As with any powerful tool, $a[AJAX] should be used with care and precision.
			Let&apos;s face the facts, too: most modern Web developers write sloppy code that can&apos;t even pass simple validation.
			$a[AJAX] is a tool that requires skill to use well, but the majority of those using it don&apos;t make the effort to actually become skilful.
		</p>
	</blockquote>
	<blockquote>
		<p>
			You make a good point that $a[AJAX] can be used to request more than just $a[HTTP]-based files.
			It can be used to communicate with $a[FTP] servers as you mentioned, and I&apos;ve also seen it used to communicate with $a[IRC] servers.
			In this way, an $a[FTP] client, $a[IRC] client, or other type of client can be built in JavaScript and executed in a Web browser.
		</p>
	</blockquote>
	<blockquote>
		<p>
			$a[AJAX] can certainly make pages more interactive, though whether it makes them &quot;better&quot; is up for debate.
			Like JavaScript itself, $a[AJAX] is over-used.
			If used for peripheral components of a page, $a[AJAX] can be a very good thing.
			But when developers rely on $a[AJAX] to provide functionality that should be available even without JavaScript enabled, it causes a severe accessibility problem.
			In other words, $a[AJAX] (and JavaScript in general) often make pages <strong>*worse*</strong> in the hands of uncaring and/or unskilled developers.
		</p>
	</blockquote>
	<p>
		After completing the discussion assignment, I completed the easy half of my grading for the week.
		I didn&apos;t want to complete the difficult half, but then I pushed myself to complete that as well.
		The results of all the grading were disappointing.
		On the Codecademy-based assignment, students didn&apos;t even complete the work entirely.
		I&apos;d blame the ambiguous assignment instructions, but the students completing the perfectly-clear-if-you-have-Windows assignment didn&apos;t fair any better.
		Well, the Windows users didn&apos;t, anyway.
		I think my feedback note to the OS X user pretty much sums up my thoughts, aside from one thought that I can&apos;t even put here in my journal in case the wrong person reads it:
	</p>
	<blockquote>
		<p>
			This week, I graded the work of two Windows users and one OS X user. Neither Windows user seemed to be able to even follow the directions correctly. You, however, even without having the ability to run the software the assignment called for, produced an otherwise-perfectly-completed assignment submission. I swear, Windows users don&apos;t know what they&apos;re doing when it comes to computers. Then again, if they knew what they were doing, they wouldn&apos;t be using the world&apos;s buggiest operating system, would they?
		</p>
	</blockquote>
	<p>
		I <strong>*really*</strong> wasn&apos;t up to completing the reading assignment for the operating systems course, let alone completing that course&apos;s discussion assignment based on the reading material.
		Likewise, the main assignment for the week will be above my head until I&apos;ve read and come to understand the content of the assigned chapters.
		I thought I deserved to go get a snack for having completed a good chunk of my assigned work, but after some thought, I decided to try completing another assignment before work.
		This assignment involved writing $a[XML] files, so it was incredibly easy.
		Easy doens&apos;t mean not time-consuming though.
		I quickly found I wasn&apos;t going to finish before work, so I put it down and went to get my snack and clock in instead.
	</p>
</section>
<section id="docmod">
	<h2>Document modifications</h2>
	<p>
		On <a href="/en/weblog/2017/11-November/02.xhtml">2017-11-02</a>, this journal page was modified in order to redact the name of the university.
	</p>
</section>
END
);
